//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;

namespace EntLibContrib.Resource.Instrumentation
{
	/// <summary>
	/// Represents the WMI event fired when an error ocurred in the resource block.
	/// </summary>
	public class ResourceFailureEvent : ResourceEvent
	{
		#region Fields
		private string errorMessage;
		private string exceptionMessage;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the message that describes the failure.
		/// </summary>
		public string ErrorMessage
		{
			get { return errorMessage; }
		}

		/// <summary>
		/// Gets the message that represents the exception causing the failure.
		/// </summary>
		public string ExceptionMessage
		{
			get { return exceptionMessage; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceFailureEvent"/> class.
		/// </summary>
		/// <param name="instanceName">The name of the <see cref="ResourceManager"/> instance this failure ocurred in.</param>
		/// <param name="errorMessage">The message that describes the failure.</param>
		/// <param name="exceptionMessage">The message that represents the exception causing the failure.</param>
		public ResourceFailureEvent(string instanceName, string errorMessage, string exceptionMessage)
			: base(instanceName)
		{
			this.errorMessage = errorMessage;
			this.exceptionMessage = exceptionMessage;
		}
		#endregion
	}
}